# 1.到模块
from docx import Document

# 2.创建文档 --
doc = Document()

# 3.添加段落
from docx.document import Document

doc: Document = doc
para = doc.add_paragraph(text='15-段落操作分析')

# 4.添加run
run = para.add_run(text='----鹅鹅鹅呃呃呃')

# 5.设置 字体  设置加粗 斜体
run.font.name = 'Calibri'
run.font.bold = True
run.font.italic = True
run.font.underline = True

from docx.shared import Pt

run.font.size = Pt(50)

# 6.设置颜色
from docx.shared import RGBColor

run.font.color.rgb = RGBColor(0x00, 0xFF, 0x00)

# 7.保存文档
doc.save('08run.docx')
